<script language="javascript" src="<?php echo $img_url; ?>style/js/FE/fe_docs.js"></script>
<!-- tin moi nhat -->
<div id="latest-title">
    <span class="title"><?php echo $page_title; ?></span>
    <img src="<?php echo $img_url; ?>style/images/img28.gif">
    <div class="ico-social">
        <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $current_url; ?>&display=popup&ref=plugin" target="_blank"><img src="<?php echo $img_url; ?>style/images/imgfb.gif" width="16" height="16" border="0"></a>
        <a href="https://twitter.com/share" target="_blank"><img src="<?php echo $img_url; ?>style/images/imgtw.gif" width="16" height="16" border="0"></a>
        <a href="https://plus.google.com/share?url=<?php echo $current_url; ?>" target="_blank"><img src="<?php echo $img_url; ?>style/images/imggp.gif" width="16" height="16" border="0"></a>
        <a href="javascript:void(0);" onclick="return openPopup('contactForm')"><img src="<?php echo $img_url; ?>style/images/imgma.gif" width="16" height="16" border="0"></a>
        <a href="javascript:void(0);" onclick="javascript:window.print();"><img src="<?php echo $img_url; ?>style/images/imgpr.gif" width="16" height="16" border="0"></a>
        <span class="time">
            <?php
            //show date time Tieng Viet
            $str_search = array(
                "Mon",
                "Tue",
                "Wed",
                "Thu",
                "Fri",
                "Sat",
                "Sun"
            );
            $str_replace = array(
                "Th&#7913; hai",
                "Th&#7913; ba",
                "Th&#7913; t&#432;",
                "Th&#7913; n&#259;m",
                "Th&#7913; s&#225;u",
                "Th&#7913; b&#7843;y",
                "Ch&#7911; nh&#7853;t"
            );
            $timenow = gmdate("D, d/m/Y | H:i", time() + 7 * 3600);
            $timenow = str_replace($str_search, $str_replace, $timenow);
            echo $timenow;
            ?>      
        </span>
    </div>
</div>  
<div id="seperator"></div>
<div id="docs-search">
  <form name="trueform2" id="trueform2" method="POST" action="<?php echo $base_url; ?>van-ban-phap-quy/tim-kiem">
      <input type="text" value="<?php if (isset($txt_Docs_Keyword)) echo $txt_Docs_Keyword; ?>" id="txt_DOCS_Keyword" name="txt_DOCS_Keyword" class="DOCS_Keyword" placeholder="Nhập văn bản cần tìm">
      <input type="text" value="<?php if (isset($cate_name)) echo $cate_name; ?>" id="txt_DOCS_Cate" name="txt_DOCS_Cate" placeholder=" Chọn loại văn bản" onclick="Docs.toogleCate();" readonly>
      <img src="<?php echo $img_url; ?>style/img/showmore.png" class="buttonShowMore" onclick="Docs.toogleCate();" />
      <input type="hidden" name="isPost" value="1">
      <input type="hidden" name="hidCateId" id="hidCateId" value="<?php if (isset($cbo_docs_cate)) echo $cbo_docs_cate; ?>">
      <input type="hidden" name="h_cur_page" id="h_cur_page" value="1">
      <input type="button" value="Tìm" id="txt_DOCS_Search" name="txt_DOCS_Search" class="DOCS_Search" onClick="return submitSearch('<?php echo $base_url; ?>van-ban-phap-quy/tim-kiem', 1);">
  </form>
</div>
<?php
if (isset($aDocs) && count($aDocs) > 0) {
?>
  <br>
	<table width="670" border="0" cellspacing="1" cellpadding="0" bgcolor="#CCCCCC" class="van-ban-phap-quy">
    <tr height="30px">
      <td bgcolor="#FFFFFF" width="40" class="cell" align="center"><strong>STT</strong></td>
      <td bgcolor="#FFFFFF" width="140" class="cell" align="center"><strong>Số công văn</strong></td>
      <td bgcolor="#FFFFFF" width="100" class="cell" align="center"><strong>Ngày ban hành</strong></td>
      <td bgcolor="#FFFFFF" width="100" class="cell" align="center"><strong>Ngày hiệu lực</strong></td>
      <td bgcolor="#FFFFFF" width="290" class="cell" align="center"><strong>Nội dung</strong></td>
    </tr>  
  <?php
		$i = $pagesize*($cur_page-1)+1;
		foreach ($aDocs as $key => $item):
	?>
    <tr>
      <td bgcolor="#FFFFFF" width="40" class="cell">
      <div style="padding:8px; text-align:center;">
			<?php echo $i;?>
      </div>      
      </td>
      <td bgcolor="#FFFFFF" width="140" class="cell">
      <div style="padding:8px;">
			<?php echo $item->title;?>
      </div>
      </td>
      <td bgcolor="#FFFFFF" width="100" class="cell">
      <div style="padding:8px;">
			<?php echo date("Y-m-d", strtotime($item->issue_date));?>
      </div>
      </td>
      <td bgcolor="#FFFFFF" width="100" class="cell">
      <div style="padding:8px;">
      <?php echo date("Y-m-d", strtotime($item->apply_date));?>
      </div>      
      </td>
      <td bgcolor="#FFFFFF" width="290" class="cell">
      <div style="padding:8px;">
			<?php echo $item->desc;?>
      <?php
				if ($item->file != ""){
			?>
      <br>
      <a class="vbpq-downloadfile" href="<?php echo $img_url."style/".$item->file; ?>" target="_blank"><img src="<?php echo $img_url; ?>style/images/Save-icon.png" border=0 valign="middle"><span style="padding-left: 5px;">Tải về</span></a>
      <?php
				}
			?>
      </div>      
      </td>      
    </tr>
  <?php
			$i++;
		endforeach;
	?>
  </table>
  <div id="news-paging">
      <?php echo $paging; ?>
    <!--<span class="page-status">Trang <?php echo $cur_page; ?> của 90</span>-->
  </div>  
  <?php
}
else
    echo "<br><br><div align='center' class='nodata'>" . $page_nodata . "</div>";
?>     
<!-- end of DOCS -->
<br><br>
<div id="docs_cate">
    <?php
    if ($aDocsCate != null && sizeof($aDocsCate) > 0) {
        $itemPerColumn = round(sizeof($aDocsCate) / 2);
        ?>
        <ul class="cate_content">
            <?php for ($i = 0; $i < $itemPerColumn; $i++) { ?>
                <li onclick="Docs.selectCate('<?php echo $aDocsCate[$i]->cate_id; ?>', '<?php echo $aDocsCate[$i]->cate_name; ?>');"><?php echo $aDocsCate[$i]->cate_name; ?></li>
            <?php } ?>
        </ul>
        <ul class="cate_content">
            <?php for ($i = $itemPerColumn; $i < sizeof($aDocsCate); $i++) { ?>
                <li onclick="Docs.selectCate('<?php echo $aDocsCate[$i]->cate_id; ?>', '<?php echo $aDocsCate[$i]->cate_name; ?>');"><?php echo $aDocsCate[$i]->cate_name; ?></li>
            <?php } ?>
        </ul>
    <?php } ?>
    <div class="clearfix"></div>
</div>
